package org.convallaria.infrastruct.rg.exception;

/**
 * 注册发现异常基类
 * 
 * @author gjh
 * @since 2025-01-27
 */
public class RegistryException extends RuntimeException {
    
    private final String errorCode;
    private final String serviceId;
    
    public RegistryException(String message) {
        super(message);
        this.errorCode = "REGISTRY_ERROR";
        this.serviceId = null;
    }
    
    public RegistryException(String message, Throwable cause) {
        super(message, cause);
        this.errorCode = "REGISTRY_ERROR";
        this.serviceId = null;
    }
    
    public RegistryException(String errorCode, String message) {
        super(message);
        this.errorCode = errorCode;
        this.serviceId = null;
    }
    
    public RegistryException(String errorCode, String message, String serviceId) {
        super(message);
        this.errorCode = errorCode;
        this.serviceId = serviceId;
    }
    
    public RegistryException(String errorCode, String message, String serviceId, Throwable cause) {
        super(message, cause);
        this.errorCode = errorCode;
        this.serviceId = serviceId;
    }
    
    public String getErrorCode() {
        return errorCode;
    }
    
    public String getServiceId() {
        return serviceId;
    }
}
